#ifndef DSPSIMULATOR_LDNW_H
#define DSPSIMULATOR_LDNW_H

#include <dspSimulator/targetMachine/dspInstruction.h>

class LDNW : public DspInstruction {
public:
    explicit LDNW(u64 addresss = 0, u64 baseCycle = 0) :
            DspInstruction("LDNW", addresss, baseCycle, 4) {};

    ~LDNW() override = default;

    LDNW(const LDNW &ldw) = default;

    bool checkCondition(std::shared_ptr<DspMachine> dspMachine) override;

    void loadInstIRIntoJit(llvm::LLVMContext *llvmContext, llvm::Module *module,
                           std::shared_ptr<llvm::IRBuilder<>> irBuilder) override;

    std::shared_ptr<Instruction> decode(std::shared_ptr<InstInfo> instInfo, u64 baseCycle) override;

    void executeCustom(std::shared_ptr<TargetMachine> targetMachine, ExecutePhase executePhase) override;

    std::string toString() const override;

    std::shared_ptr<DspInstruction> clone() override;

private:
    u32 m_visitMemAddr = 0;
    std::vector<u8> m_data;
};

#endif //DSPSIMULATOR_LDNW_H
